<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{ message }}</h1>
        <p>count={{count}}</p>
        <span>{{flag}}</span>
        <span>{{time}}</span>
        <hr>
        <button @click="console.log(Date.now())" >print Date</button>
        <button @click=" count=count+1 ">count++</button>
    </div>

    <script src="./vue.global.prod.js"></script>
    <script>
        //提取出 Vue 中的API
        const { createApp } = Vue;

        //核心 设置对象
        let option = {//对象
            data:  function () {
                return { // 数据仓库
                    message: 'Hello Vue!',
                    count: 100,
                    flag: true, // boolean
                    time: new Date()// 当前所在客户端时间
                };
            }
        };
        //创建应用
        let app = createApp(option);
        //挂载
        app.mount('#app');
    </script>
</body>

</html>